package com.stu.spring.sim.circular;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

@ComponentScan
@Configuration
@EnableAsync
public class SpringCircularCtxTest {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringCircularCtxTest.class);
        // 获取 Bean 并使用
        AService bean = (AService)context.getBean("AService");
        // 额外加了 @Async 注解
        bean.sayA();
        context.close();
    }

}
